import { PromiseData } from '@/@types/request'
import request from '@/utils/request'
import { IYearList } from '@/pages/DataFilling/type'

// 城市
export interface AreaList {
  id: number
  name: string
}

// 获取季度
export const getTheQuarter = (): Promise<PromiseData<IYearList[]>> => request.get('/TimeQuarter/searchYear')

// 根据权限查地区
export const getRoleAreaList = (data: { hospitalCode?: number } = {}): Promise<PromiseData<AreaList[]>> =>
  request.post('/TimeQuarter/searchProvinceAndCityData', data)

// 查病区参数
export interface WordParams {
  hospitalId?: number
  hospitalCode?: number
  dataReportYear?: string // 季度年份
  dataReportQuarter?: string // 年的哪个季度
}
// 病区数据
export interface WordList {
  dataId: number
  wordId: number
  wordName: string
}
// 根据医院年份季度查询上报病区
export const getWord = (data: WordParams): Promise<PromiseData<WordList[]>> =>
  request.post('/TimeQuarter/searchWord', data)
// /dataReport/getDataTaskDetail 变量
